Next | Prev | Up | Top | Contents | Index
Using the Visual Info Extension
To find a visual that best matches specified attributes, call glXChooseVisual():
XVisualInfo* glXChooseVisual( Display *dpy, int screen, int *attrib_list )
- If GLX_RGBA is in attrib_list, you can choose a TrueColor or DirectColor visual by setting GLX_X_VISUAL_TYPE_EXT to GLX_TRUE_COLOR_EXT or GLX_DIRECT_COLOR_EXT, respectively.
- If you set GLX_X_VISUAL_TYPE_EXT to PseudoColor, StaticColor, GrayScale, or StaticGray, visual selection will fail.
- If GLX_X_VISUAL_TYPE_EXT is not in attrib_list, and if all other attributes are equivalent, a TrueColor visual is chosen in preference to a DirectColor visual.
- If GLX_RGBA is not in attrib_list, you can choose a PseudoColor or StaticColor visual by setting GLX_X_VISUAL_TYPE_EXT to GLX_PSEUDO_COLOR or GLX_STATIC_COLOR, respectively.
- If you set GLX_X_VISUAL_TYPE_EXT to TrueColor, DirectColor, GrayScale, or StaticGray, visual selection will fail.
- If GLX_X_VISUAL_TYPE_EXT is not in attrib_list, and if all other attributes are equivalent, a PseudoColor visual is chosen in preference to a StaticColor visual.
- If an undefined GLX attribute, or an unacceptable enumerated attribute value is encountered, NULL is returned.
More attributes may be specified in the attribute list. If a visual attribute is not specified, a default value is used. See the glXChooseVisual() reference page for more detail.
To free the data returned, use XFree().
Next | Prev | Up | Top | Contents | Index